#include "dactiveelement.h"
#include "gactiveelement.h"
#include <QtXml/QDomDocument>

void  DActiveElement::parseDetail(const QDomElement& e)
{
	if ( e.nodeName() == "port") {
		DPort* port = new DPort(this);
		port->name = e.attribute("name");
		port->typeOf = e.attribute("type");
		port->direction = e.attribute("direction");
		if ( port->direction=="in" )
			port->ordinal = mInPorts++;
		else
			port->ordinal = mOutPorts++;

		if (e.attribute("multiple", "false") == "false") 
			port->multiple = false;
		else
			port->multiple = true;
		port->note = e.text();

		mPorts.append(port);

	}
}

GElement* DActiveElement::doCreateGraphics() 
{ 
	return new GActiveElement(this); 
}